<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<link rel="stylesheet" type="text/css" href="<s:url value='/CSS/back/order/order_list.css'/>"/>
<table class="view-orders">
  <caption>View Orders</caption>
  <tr class="tr1">
    <td class="td1">OrderNo</td>
    <td class="td2">TotalPrice</td>
    <td class="td3">UserName</td>
    <td class="td4">Payment</td>
    <td class="td5">CreatedTime</td>
    <td class="td6">State</td>
    <td class="td7">Update State</td>
  </tr>
  <s:iterator var="order" value="pagination.list" status="stat">
    <tr class="tr2" id="row_<s:property value='#stat.index'/>"
          onmouseover="onChange('row_<s:property value='#stat.index'/>', 0)"
          onmouseout="onChange('row_<s:property value='#stat.index'/>', 1)">
      <td class="td1"><s:property value="#order.orderNo"/></td>
      <td class="td2"><s:property value="#order.totalPrice"/></td>   
      <td class="td3"><s:property value="#order.user.userName"/></td>
      <td class="td4"><s:property value="#order.payment.getName()"/></td>
      <td class="td5"><s:date name="#order.createdTime" format="yyyy-MM-dd HH:mm:ss"></s:date></td>
      <td class="td6"><s:property value="#order.state.getName()"/></td>
      <td class="td7">
        <s:url action="orderAction_select" namespace="/back/order" var="orderAction_select">
          <s:param name="order.orderId" value="#order.orderId"/>
        </s:url>
        <a href="javascript:" onclick="javascript:openWindow('${orderAction_select}', 500, 200);">Update</a>
      </td>
    </tr>
  </s:iterator> 
</table>
<div class="pagination">
  <s:url action="orderAction_list" namespace="/back/order" var="first">
    <s:param name="pageNo" value="1"/>
  </s:url>
  <s:url action="orderAction_list" namespace="/back/order" var="previous">
    <s:param name="pageNo" value="pagination.pageNo - 1"/>
  </s:url>
  <s:url action="orderAction_list" namespace="/back/order" var="next">
    <s:param name="pageNo" value="pagination.pageNo + 1"/>
  </s:url>
  <s:url action="orderAction_list" namespace="/back/order" var="last">
    <s:param name="pageNo" value="pagination.lastPageNo"/>
  </s:url>
  <s:include value="/WEB-INF/JSP/pagination.jsp"/>
</div>
<script type="text/javascript" src="<s:url value='/JS/jquery-1.7.2.min.js'/>"></script>
<script type="text/javascript" src="<s:url value='/JS/common.js'/>"></script>